package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class ReadFile {
    public static void main(String[] args) throws IOException {
        FileInputStream fis =new FileInputStream("fos.txt");
        byte [] data =new byte[1024*10];//一次读1k
        int d =fis.read(data);
        System.out.println("读取了"+d+"个字节");
        String line =new String(data,StandardCharsets.UTF_8);
        System.out.println(line);
        fis.close();
    }
}
